package com.education.web.dto;


import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * @author zengjintao
 * @version 1.0
 * @create_at 2019/12/17 20:16
 */
public class SystemSecurityUser extends User {

    private AdminUserSession adminUserSession;

    public SystemSecurityUser(AdminUserSession adminUserSession, Collection<? extends GrantedAuthority> authorities) {
        super(adminUserSession.getSystemAdmin().getLoginName(),
                adminUserSession.getSystemAdmin().getPassword(), authorities);
        this.adminUserSession = adminUserSession;
    }

    public String getEncrypt() {
        return this.adminUserSession.getSystemAdmin().getEncrypt();
    }
    public AdminUserSession getAdminUserSession() {
        return adminUserSession;
    }

    public void setAdminUserSession(AdminUserSession adminUserSession) {
        this.adminUserSession = adminUserSession;
    }
}
